package com.webflux.sample.webfluxmain;

import java.time.Duration;
import java.time.temporal.ChronoUnit;
import reactor.core.publisher.Flux;

public class _2flux_static_method {

  public static void main(String[] args) {
    Flux.just("Hello", "World").subscribe(System.out::println);
    Flux.fromArray(new Integer[]{1, 2, 3}).subscribe(System.out::println);
    Flux.empty().subscribe(System.out::println);
    Flux.range(1, 10).subscribe(System.out::println);

    System.out.println("interval,这个方法不是很理解，貌似可以理解为异步定时执行的逻辑");
    Flux.interval(Duration.of(10, ChronoUnit.SECONDS)).subscribe(System.out::println);
  }

}
